package Servlet;

import model.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class Util {
    public static User checkLogin(HttpServletRequest req){
        HttpSession session=req.getSession(false);
        if(session==null){
            return null;
        }
        User user=(User) session.getAttribute("user");
        return user;
    }
}
